<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class AddColumnIsConfirmInTaskTable extends AbstractMigration
{
    public function up()
    {
        $this->table('entity')
            ->addColumn('is_confirm', 'enum', ['values' => 'yes,no', 'default' => 'no', 'comment' => '任务是否确认'])
            ->addIndex(['is_confirm'], ['type' => 'normal', 'name' => 'idx_is_confirm'])
            ->save();
    }

    public function down()
    {
        $this->table('entity')->removeIndexByName('idx_is_confirm')->removeColumn('is_confirm')->save();
    }
}
